<%@page import="aex.domain.ArticleCategory"%>
<%@page import="aex.domain.Article"%>
<%@page import="aex.service.ShowViewService"%>
<%@page import="aex.util.SSHUtil"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="aex.domain.Puser"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
WebApplicationContext ac = SSHUtil.getApplication(request);
ShowViewService svService = (ShowViewService) ac.getBean(ShowViewService.SERVICE_NAME);
%>

<!DOCTYPE>
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta name="keywords" content="${webKeyWord}">
	<meta name="description" content="${webDescription}" />
	<title> ${webTitle} </title>
	
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
  	
	<link rel="stylesheet" type="text/css" href="expandStyle/aex_userPage.css">
	<link rel="stylesheet" type="text/css" href="expandStyle/album.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/index.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/ex_focusCarousel.css">
	
	<script type="text/javascript" src="systemJs/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="systemJs/H-ui.admin.js"></script>
	<script type="text/javascript" src="expandStyle/aex_userPage.js"></script>
	<script type="text/javascript" src="expandStyle/ex_focusCarousel.js"></script>
	<script type="text/javascript" src="expandStyle/move.js"></script>
	
	</head>
  <body>
    
    <!--导航栏-->
    
    <%
    	Puser user=(Puser)request.getSession().getAttribute("user");
    	if(user==null){
    		%>
    			<jsp:include page="/systemPage/headNavVisitor1.jsp"></jsp:include>		
    		<%
    	}else{
    		%>
				<jsp:include page="/systemPage/headNavVisitor2.jsp"></jsp:include>
    		<%
    	}
    %>
	
	
	
	
	  <!--幻灯片-->
  <div id="demo01" class="flexslider">
	<ul class="slides">
		<li><div class="img"><img src="images/aex_userImg/ad_home.jpg" height="375px" width="1050px" alt="" /></div></li>
		<li><div class="img"><img src="images/aex_userImg/ad_nba.jpg" height="375px" width="1050px" alt="" /></div></li>
		<li><div class="img"><img src="images/aex_userImg/ad_stock.jpg" height="375px" width="1050px" alt="" /></div></li>
	</ul>
  </div><!--flexslider end-->

 <!--主要内容-->
  <div class="container">
  	 <div class="container_left">
  	 	 <!--专题栏-->
  	 	<div class="special_box">
  	 	<%
  	 		List<Article> arts=svService.getShowBoxArticle("首页推荐", null);
  	 		for(Article art:arts){
  	 			out.print("<div class='special'>"+
  	 	  	 				"<div class='special_img'><img src='"+art.getArAuthor()+"' width='180px' height='180px'></div>"+
  	 	  	 				"<div class='special_content'>"+
  	 	  	 						"<h2><a href='visitor/visitor_article.do?arId="+art.getArId()+"'>"+art.getArTitle()+"</a></h2>"+
  	 	  	 						"<div class='explains'>"+
	  	 	  	 						"<span>来源："+art.getArticleCategory().getAcName()+"   </span><span>作者："+art.getPuser().getPuName()+" </span>"+
	  	 	  	 						"<div>: "+art.getArTime().toLocaleString()+"</div>"+
  	 	  	 						"</div>"+
  	 	            				"<div class='s_smallCont'>"+art.getArAbstract()+"</div>"+
  	 	            				"<div class='read_more'> <span>浏览量 ("+art.getArViewCount()+")</span><span>评论 ("+art.getArComentCount()+")</span> <div><a href='visitor/visitor_article.do?arId="+art.getArId()+"'>查看更多</a></div></div>"+
	  	 	  	 			"</div>"+
	  	 	  	 		"</div>");
  	 		}
  	 	
  	 	%>
        <!--更多专题-->
        <div class="more_special"><a href="visitor/visitor_themePage.do">更多专题</a></div>
        
        
        <!--本周活跃用户-->
         <div id="active_usersBox">
           <div class="active_left">
              <embed src="http://player.youku.com/player.php/Type/Folder/Fid/23797719/Ob/1/sid/XOTU3MDE3OTU2/v.swf" quality="high" width="350" height="238" align="left" allowScriptAccess="always" allowFullScreen="true" mode="transparent" type="application/x-shockwave-flash"></embed>
           </div>
           <div class="active_right">
              <!--焦点图  5   开始 -->
               <div id="focusCarousel_box5">
                    <ul class="focusCarousel_ul5">
                    
                   	<%
		           		List<Article> docters=svService.getShowBoxArticle("首页焦点图", 5);
                   		int count = docters.size();
                   		boolean flag=true;
		           		for(Article art:docters){
							if(flag){
			           			out.print("<li style='display:block;filter:alpha(opacity=100);opacity:1;' >"+
			           			"<a  class='focusCarousel_li5'  href='visitor/visitor_article.do?arId="+art.getArId()+"'>"+
			           			"<img src="+art.getArAuthor()+" width='350' height='238'></a></li>");
			           			flag=false;
							}else{
			           			out.print("<li><a  class='focusCarousel_li5'  href='visitor/visitor_article.do?arId="+art.getArId()+"'><img src="+art.getArAuthor()+" width='350' height='238'></a></li>");
							}
		           		}
		           		out.print(" <ol class='focusCarousel_ol5'>");
		           		for(int i=0;i<count; i++){
		           			if(i==0){
		           				out.print("<li class='focus_active5'>"+i+1+"</li>");
		           			}else{
		           				out.print("<li>"+i+1+"</li>");
		           			}
		           		}
		           		out.print(" </ol>");
           			%>
                    </ul>
               </div>
          <!--焦点图  5   结束 -->
          
          
           </div>
        </div>
        <!--推荐小组-->
        <div id="recommend_group">
            <h2>推荐小组</h2>
            
            <div class="more_group"><a href="visitor/visitor_categoryList.do">更多小组</a></div>
            <%
				List<ArticleCategory> categorys=svService.getAllCategory();
            	for(ArticleCategory category: categorys){
            		out.print("<div class='group'>"+
            	              " <div class='group_img'><img src='"+category.getAcPhoto()+"' width='80px' height='80px'></div>"+
            	               "<div class='group_content'>"+
            	               "   <div class='group_name'><a href='visitor/visitor_showCategory.do?id="+category.getAcId()+"'>"+category.getAcName()+"</a><span>共3302人</span></div>"+
            	                "  <div class='smallContent'>"+category.getAcDescription()+ "</div>"+
            	                "  <div class='join_group'><a href='visitor/visitor_showCategory.do?id="+category.getAcId()+"'>进入小组</a></div>"+
            	             "  </div>"+
            	           " </div>");
            	}
            
            %>
        </div>
  	 	</div>
  	 </div>
  	 
  	 <!-- 侧边栏 -->
  	 <jsp:include page="/systemPage/cbl1.jsp"></jsp:include>
  	 
  	 
  	 
  </div>
	
	
    <!--网站底部-->
	<jsp:include page="/systemPage/footerVisitor.jsp"></jsp:include>
	<a href="adminPage/login.jsp">后台管理</a>
    <script type="text/javascript" src="expandStyle/album.js"></script> 
<script type="text/javascript">
	

	/**幻灯片**/
	$(function(){
	$('#demo01').flexslider({
		animation: "slide",
		direction:"horizontal",
		easing:"swing"
	});
});
</script>
    
  </body>
</html>
